from redis import StrictRedis

class Config:
    DEBUG = None
    # 设置密钥
    SECRET_KEY = '47iURw81TEoHOzQWDzddMJnOd/RNBbTiCDYVkXge/kl0wZ61kzy+yQ=='
    # 配置mysql数据的链接信息，动态追踪修改
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@localhost/info1'
    SQLALCHEMY_TRACK_MODIFICATIONS =False

    # 定义主机和端口（扩展性更强）
    REDIS_HOST = '127.0.0.1'
    REDIS_POST = 6379
    # 配置redis链接信息，实现状态保持存储用户的session信息
    SESSION_TYPE = 'redis'
    SESSION_REDIS = StrictRedis(REDIS_HOST,REDIS_POST)
    SESSION_USE_SIGNER = True
#     配置session的过期时间
    PERMANENT_SESSION_LIFETIME = 86400
class developmentConfig(Config):
    DEBUG = True


class productionConfig(Config):
    DEBUG = False

# 定义字典
config = {'development':developmentConfig,
          'production':productionConfig

}